import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'root',
    component: HomeView,
    meta: {
      title: '登录首页',
      pos: [{name: '登录首页'}],
    },
  },
  {
    path: '/topdf',
    component: () => import('../views/h5View/saveFile.vue')
  },
  {
    path: '/home',
    component: () => import('../views/HomePage.vue'),
    redirect: '/colleges',
    children: [
      {
        path: '/colleges',
        component: () => import('../views/schoolView.vue'),
      },
      {
        path: '/faculty',
        component: () => import('../views/schoolView/facultyView.vue')
      },
      {
        path: '/major',
        component: () => import('../views/schoolView/majorView.vue')
      },
      {
        path: '/lesson',
        component: () => import('../views/schoolView/lessonView.vue')
      },
      {
        path: '/agents',
        component: () => import('../views/agentView/agentList.vue')
      },
      {
        path: '/news',
        component: () => import('../views/newView/newsList.vue')
      },
      {
        path: '/carousels',
        component: () => import('../views/carouselsView/carouselsList.vue')
      },
      {
        path: '/userAgents',
        component: () => import('../views/agentView/userAgentList.vue')
      },
      {
        path: '/bes',
        component: () => import('../views/enterpriseView/list.vue')
      },
      {
        path: '/strategies',
        component: () => import('../views/diy/index.vue')
      },
      {
        path: '/docsCheck',
        component: () => import('../views/files/index.vue')
      },
    ]
  },
]

const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL),
  history: createWebHashHistory(),
  routes
})

export default router
